<?php
namespace app\beautiful\model\partner;
use app\common\model\CommonModel;
use app\beautiful\model\PartnerModel;

class PartnerWithdrawModel extends CommonModel{
    protected  $name = 'beautiful_partner_withdraw';
    protected  $pk   = 'withdraw_id';

    public function partner()
    {
        return $this->hasOne(PartnerModel::class,'partner_id','partner_id');
    }
    
    public function getAddDayAttr($value, $data) {
        return date('Y.m.d',$data['add_time']);
    }

    public function getStatusMeansAttr($value,$data)
    {
        $status_means=[
            0=>'待审核',
            1=>'提现成功'
        ];
        return $status_means[$data['status']] ?? '状态异常';
    }
  
}
